package presentation;

import java.awt.Font;
import java.util.Observable;
import java.util.Observer;

import javax.swing.JLabel;

import entity.EPatternRegister;

public class PRegisterText extends JLabel implements Observer {
	private static final long serialVersionUID = 1L;
	private Font font = new Font("Arial",Font.PLAIN,16);
	
	public PRegisterText(String text, int horizontalAlignment) {
		super(text, horizontalAlignment);
		this.setFont(font);
		this.setToolTipText(text);
	}

	@Override
	public void update(Observable obj, Object arg) {
		if (arg instanceof String && obj instanceof EPatternRegister) {
			String text = ((EPatternRegister) obj).getTextValue();
			this.setText(text);
			this.setToolTipText(text);
        }
	}
}